package com.fuss.activitytest.launchmode

import android.content.Context
import android.content.Intent
import com.fuss.activitytest.R
import kotlinx.android.synthetic.main.activity_launcher_mode.*

class LauncherModeActivity : BaseActivity() {

    companion object {

        // companion object 只是在语法形式上模仿了静态方法的调用方式
        // 给方法加上 { @JvmStatic} 注解,kotlin 编译器就会将这些方法编译成真正的静态方法
        @JvmStatic
        fun navigateTo(context: Context) {

            val intent = Intent(context, LauncherModeActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun getLayoutResID(): Int {

        return R.layout.activity_launcher_mode
    }

    override fun initListener() {

        standard_btn.setOnClickListener {

//            StandardActivity.navigateTo(this)
            doStartActivity(StandardActivity::class.java)
        }

        single_top_btn.setOnClickListener {

            SingleTopActivity.navigateTo(this)
        }

        single_task_btn.setOnClickListener {

            SingleTaskActivity.navigateTo(this)
        }

        single_instance_btn.setOnClickListener {

            SingleInstanceActivity.navigateTo(this)
        }
    }
}
